home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / packet / terminal / kam510 / kam-kbd.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-11-30  |  8.8 KB  |  217 lines

  1. procedure CommandBar;
  2. var savescreen : array[0..1999] of integer;
  3. begin
  4.   FillPage(@savescreen);
  5.   SwapVectors;
  6.   ClrScr;
  7.   Exec(GetEnv('COMSPEC'),'');
  8.   SwapVectors;
  9.   DisplayPage(@savescreen);
  10. end;
  11.  
  12. procedure check_function_keys;
  13. begin
  14.   qkey := readkey;
  15.   case qkey of
  16.  
  17.  { F1 }                #59      : help;
  18.  { alt F1              #104     : ;                           }
  19.  { shf F               #84      : ;                           }
  20.  { ctl F1 }            #94      : ;
  21.  
  22.  { F2     }            #60      : begin
  23.                                     clear_screen;
  24.                                     send_interrupt := TRUE;
  25.                                   end;
  26.  { alt F2              #105     : ;                            }
  27.  { shf F2              #85      : ;                            }
  28.  { ctl F2              #95      : ;                            }
  29.  
  30.  { F3     }            #61      : clear_transmit_screen;
  31.  { alt F3              #106     : ;                            }
  32.  { shf F3              #86      : ;                            }
  33.  { ctl F3              #96      : ;                            }
  34.  
  35.  { F4     }            #62      : clear_receive_screen;
  36.  { alt F4              #107     :                              }
  37.  { shf F4              #87      : ;                            }
  38.  { ctl F4              #97      : ;                            }
  39.  
  40.  { F5     }            #63      : view_modify_msgs;
  41.  { alt F5 }            #108     : load_messages;
  42.  { shf F5 }            #88      : save_messages;
  43.  { ctl F5              #98      : ;                            }
  44.  
  45.  { F6     }            #64      : save_buffer;
  46.  { alt F6              #109     : ;                            }
  47.  { shf F6              #89      : ;                            }
  48.  { ctl F6              #99      : ;                            }
  49.  
  50.  { F7     }            #65      : send_file;
  51.  { alt F7              #110     : ;                           }
  52.  { shf F7              #90      : ;                           }
  53.  { ctl F7              #100     : ;                           }
  54.  
  55.  { F8     }            #66      : if mode = CW then
  56.                                   begin
  57.                                    change_speed;
  58.                                     send_interrupt := TRUE;
  59.                                   end;
  60.  { alt F8              #111     : ;                           }
  61.  { shf F8              #91      : ;                           }
  62.  { ctl F8              #101     : ;                           }
  63.  
  64.  { F9     }            #67      : CountryList;
  65.  { alt F9              #112     : ;                           }
  66.  { shf F9              #92      : ;                           }
  67.  { ctl F9              #102     : ;                           }
  68.  
  69.  { F10 }               #68      : log_qso;
  70.  { alt F10             #113     : ;                           }
  71.  { shf F10             #93      : ;                           }
  72.  { ctl F10             #103     : ;                           }
  73.  
  74.  { alt 0 }             #129     : xmt_msg(0);
  75.  { alt 1 }             #120     : xmt_msg(1);
  76.  { alt 2 }             #121     : xmt_msg(2);
  77.  { alt 3 }             #122     : xmt_msg(3);
  78.  { alt 4 }             #123     : xmt_msg(4);
  79.  { alt 5 }             #124     : xmt_msg(5);
  80.  { alt 6 }             #125     : xmt_msg(6);
  81.  { alt 7 }             #126     : xmt_msg(7);
  82.  { alt 8 }             #127     : xmt_msg(8);
  83.  { alt 9 }             #128     : xmt_msg(9);
  84.  
  85.  { alt A }             #30      : case mode of
  86.                                     CW,
  87.                                     RTTY,
  88.                                     ASCII : begin
  89.                                               auto_switch := NOT auto_switch;
  90.                                               sho_status;
  91.                                             end;
  92.                                     AMTOR : begin
  93.                                               AmtorAB('');
  94.                                               sho_status;
  95.                                             end;
  96.                                   end;
  97.  { alt B }             #48      : case mode of
  98.                                     RTTY,
  99.                                     ASCII : new_rtty_baud;
  100.                                     AMTOR : begin
  101.                                               AmtorFEC;
  102.                                               sho_status;
  103.                                             end;
  104.                                   end;
  105.  { alt C }             #46      : case capture of
  106.                                     FALSE : capture_on;
  107.                                     TRUE  : capture_off;
  108.                                   end;
  109.  { alt D }             #32      : if mode = PACKET then
  110.                                     packet_disconnect;
  111.  { alt F }             #33      : send_file;
  112.  { alt H }             #35      : if mode = PACKET then
  113.                                   begin HF_Packet;
  114.                                         sho_status;
  115.                                   end;
  116.  { alt I }             #23      : case mode of
  117.                                     CW : ;
  118.                                     RTTY,ASCII : flip_invert;
  119.                                     PACKET : PacketID;
  120.                                   end;
  121.  { alt K }             #37      : case mode of
  122.                                     PACKET : if (PKCall <> '') then
  123.                                                packet_connect;
  124.                                     AMTOR  : begin
  125.                                                AmtorCall;
  126.                                                sho_status;
  127.                                              end;
  128.                                   end;
  129.  { alt L }             #38      : case mode of
  130.                                     PACKET : begin
  131.                                                MaintainCallList;
  132.                                                sho_status;
  133.                                              end;
  134.                                     AMTOR  : begin
  135.                                                AmtorListen;
  136.                                                sho_status;
  137.                                              end;
  138.                                   end;
  139.  { alt N }             #49      : KamGram;
  140.  { alt M }             #50      : begin
  141.                                     new_mode;
  142.                                     clear_screen;
  143.                                   end;
  144.  { alt P }             #25      : set_parameters;
  145.  { alt Q }             #16      : qsignals;
  146.  { alt R }             #19      : rst;
  147.  { alt S }             #31      : if mode in [RTTY,ASCII] then
  148.                                     new_rtty_shift;
  149.  { alt V }             #47      : if mode = PACKET then
  150.                                   begin VHF_Packet;
  151.                                         sho_status;
  152.                                   end;
  153.  { alt X }             #45      : exit_request;
  154.  { alt W }             #17      : if mode = CW then
  155.                                   begin
  156.                                     set_speed;
  157.                                     send_interrupt := TRUE;
  158.                                   end;
  159.  { alt Y }             #21      : if mode in [RTTY,ASCII] then
  160.                                     RYs;
  161.  { alt Z }             #44      : if mode = PACKET then
  162.                                     CmdCR(^C);
  163.  { Page Up }           #73      : review_rcv_buffer;
  164.   end;
  165.   rcv_interrupt := TRUE;
  166. end;
  167.  
  168. procedure chk_kbd;
  169. begin
  170.   if keypressed then
  171.   begin
  172.     qkey := readkey;
  173.     case file_mode of
  174.       true: case qkey of
  175.               ^T : case state of
  176.                      receive  : state := transmit;
  177.                      transmit : halt_xmt;
  178.                      transceive : ;
  179.                    end;
  180.               #0 : qkey := readkey;
  181.             end;
  182.       false: case qkey of
  183.                #0 : check_function_keys;
  184.                ^T : case state of
  185.                       receive  : state := transmit;
  186.                       transmit : halt_xmt;
  187.                       transceive : ;
  188.                     end;
  189.                #8 : del_char;
  190.                #7,#13,' '..'z' : add_char(qkey);
  191.                ^Z : if mode = PACKET then add_char(qkey);
  192.              end;
  193.     end;
  194.   if qkey = ^P then
  195.     case pause_flag of
  196.       FALSE : begin
  197.                 if mode in [ASCII,CW,RTTY,AMTOR] then
  198.                   state := receive;
  199.                 pause_flag := TRUE;
  200.               end;
  201.        TRUE : begin
  202.                 if mode in [ASCII,CW,RTTY,AMTOR] then
  203.                   state := transmit;
  204.                 pause_flag := FALSE;
  205.               end;
  206.     end;
  207.  
  208.   end;
  209.   if (mode in [CW,RTTY,ASCII]) AND
  210.      (auto_switch = TRUE)    AND
  211.      (inp_ptr <> out_ptr)        then state := transmit;
  212.  
  213. end;
  214.  
  215.  
  216.  
  217.